package com.qf.java2106.dao;

import com.qf.java2106.pojos.Food;

import java.sql.SQLException;
import java.util.List;

/**
 * @author q
 * @version V1.0
 * @date 2021/10/26
 **/
public interface IFoodDao {

    /**
     * 按key查菜品
     * @param keyword
     */
    List<Food> findFoodLikeKey(String keyword) throws SQLException;


    /**
     * 按id查菜品
     * @param id
     */
    Food findFoodById(Integer id) throws SQLException;

    /**
     * 添加菜品
     * @param food
     * @return
     */
    Integer saveFood(Food food) throws SQLException;

    /**
     * 根据菜名查菜品
     * @param foodName
     */
    Integer findFoodByName(String foodName) throws SQLException;

    /**
     * 修改菜品
     * @param food
     * @return
     */
    Integer updateFood(Food food) throws SQLException;

    /**
     * 删除菜品
     * @param id
     * @throws SQLException
     */
    Integer deleteFood(Integer id) throws SQLException;

    /**
     *
     * @param start
     * @param pageSize
     * @param typeId
     * @return
     * @throws SQLException
     */
    List<Food> findPageFood(Integer start, Integer pageSize, Integer typeId, String foodName) throws SQLException;

    /**
     * 查所有菜品数量
     * @return
     */
    Long findTotalCounts(Integer typeId, String foodName) throws SQLException;
}
